import time
f = open('m1_sorted.txt')
sp = list(map(int, f.readlines()))
start = time.time()
while True:
    fl = 1
    for i in range(0, len(sp)-1):
        if sp[i] > sp[i+1]:
            fl = 0
            sp[i], sp[i+1] = sp[i + 1], sp[i]
    if fl == 1:
        break
end = time.time()
print('m1_sorted', round((end-start)*1000), 'milliseconds')
f = open('m2_reverse.txt')
sp = list(map(int, f.readlines()))
start = time.time()
while True:
    fl = 1
    for i in range(0, len(sp)-1):
        if sp[i] > sp[i+1]:
            fl = 0
            sp[i], sp[i+1] = sp[i + 1], sp[i]
    if fl == 1:
        break
end = time.time()
print('m1_sorted', round((end-start)*1000), 'milliseconds')f = open('m1_sorted.txt')
f = open('m3_shuffle.txt')
sp = list(map(int, f.readlines()))
start = time.time()
while True:
    fl = 1
    for i in range(0, len(sp)-1):
        if sp[i] > sp[i+1]:
            fl = 0
            sp[i], sp[i+1] = sp[i + 1], sp[i]
    if fl == 1:
        break
end = time.time()
print('m1_sorted', round((end-start)*1000), 'milliseconds')